package com.smart.model.convert;

import com.smart.model.dtomapper.OperateUserRoleDtoMapper;
import com.smart.model.domain.OperateUserRoleDO;
import com.smart.model.vo.OperateUserRoleVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class OperateUserRoleConvert {

    public static List<OperateUserRoleVO> buildOperateUserRoleVoList(List<OperateUserRoleDO> operateUserRoleDOList) {
        if (CollectionUtils.isEmpty(operateUserRoleDOList)) {
            return Lists.newArrayList();
        }
        List<OperateUserRoleVO> operateUserRoleVOList = new ArrayList<>();
        for (OperateUserRoleDO operateUserRoleDO : operateUserRoleDOList) {
            operateUserRoleVOList.add(OperateUserRoleDtoMapper.INSTANCE.do2VO(operateUserRoleDO));
        }

        return operateUserRoleVOList;
    }
}
